package com.nebula.poi.controller;


import com.nebula.poi.config.ExcelImport;
import com.nebula.poi.pojo.SysOrgExcel;
import org.hibernate.validator.constraints.URL;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


import javax.json.JsonObject;
import java.io.File;
import java.util.List;
import java.util.Map;


/**
 * @Author: llq
 * @Date: 2019/11/27
 */
@RestController
@RequestMapping("/derive")
public  class deriveController {

    @GetMapping("/derive")
    public void importDerive(@RequestParam("file") MultipartFile file){
        ExcelImport<SysOrgExcel> sysOrgExcelExcelImport = new ExcelImport<>(SysOrgExcel.class);
        Map<String, Object> map = sysOrgExcelExcelImport.importExcel((File) file);
        List<SysOrgExcel> sysOrgExcels = (List<SysOrgExcel>)map.get("data");
        sysOrgExcels.forEach(sysOrgExcel -> {
        });

    }
}

